Skip to content

Conversation

einalien
Copy link
Owner

@einalien einalien commented Nov 8, 2026 •

Summary

This PR extends the existing infrastructure destruction workflow to support both TEST and STAGE using a GitHub Actions matrix.

It also improves CI tool version management by centralizing OpenTofu, TFLint, and Checkov versions in dedicated configuration files.

Changes

Infrastructure Destruction

  • Extended destroy.yml to support TEST and STAGE through a matrix strategy.
  • Configured environment-specific paths, credentials, and remote state.
  • Restricted destruction to manually triggered workflows from main.
  • Preserved destruction order: frontend before network.
  • Added environment-aware validation of Kubernetes remote-state backends.
  • Limited matrix execution to one environment at a time using max-parallel: 1.
  • Kept PROD destruction excluded until separately implemented and verified.

CI Improvements

  • Centralized OpenTofu version management using .opentofu-version.
  • Added .tflint-version for consistent TFLint version management.
  • Added requirements-checkov.txt for pinned Checkov dependencies.
  • Updated ci.yml to install tools using the dedicated version files.

Workflow

Manual destruction:

Destroy Infrastructure
        |
        v
   Matrix Strategy
     /       \
   TEST      STAGE
     |         |
 Frontend   Frontend
     |         |
  Network   Network

Each environment uses its own GitHub environment configuration and Kubernetes remote state.

Validation

  • CI checks passed.
  • Successful TEST destruction.
  • Successful TEST recreation after destruction.
  • Configured STAGE destruction using the existing matrix workflow.
  • Restricted destruction to TEST and STAGE.
  • Verify successful STAGE destruction.
  • Verify successful STAGE recreation.

Notes

  • Destruction requires manual execution through GitHub Actions.
  • A single workflow execution targets both TEST and STAGE.
  • max-parallel: 1 prevents simultaneous matrix jobs but does not guarantee execution order.
  • PROD destruction is not included in this PR.
  • The existing deployment pipeline continues to block destructive changes during normal deployments.

@einalien einalien self-assigned this Nov 8, 2026
@einalien einalien added the enhancement New feature or request label Nov 8, 2026
@einalien einalien merged commit f352621 into main Nov 8, 2026
1 check passed
@einalien einalien deleted the feat/cd-destroy-stage branch November 8, 2026 19:25
Sign in to join this conversation on GitHub.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant